package com.edu.exam.enums.course;


/**
 * 教学班类型枚举
 * 管理教学班的各种分类
 *
 * @author System
 * @version 1.0.0
 */
public enum TeachingClassType {

    THEORY("THEORY", "理论课", 1),
    EXPERIMENT("EXPERIMENT", "实验课", 2),
    PRACTICE("PRACTICE", "实习课", 3),
    MIXED("MIXED", "混合课", 4),

    // 课程性质细分
    BASIC_THEORY("BASIC_THEORY", "基础理论", 10),
    PROFESSIONAL_THEORY("PROFESSIONAL_THEORY", "专业理论", 11),
    GENERAL_EDUCATION("GENERAL_EDUCATION", "通识教育", 12),
    LANGUAGE_TRAINING("LANGUAGE_TRAINING", "语言训练", 13),

    // 实验课程细分
    PHYSICS_EXPERIMENT("PHYSICS_EXPERIMENT", "物理实验", 20),
    CHEMISTRY_EXPERIMENT("CHEMISTRY_EXPERIMENT", "化学实验", 21),
    BIOLOGY_EXPERIMENT("BIOLOGY_EXPERIMENT", "生物实验", 22),
    COMPUTER_EXPERIMENT("COMPUTER_EXPERIMENT", "计算机实验", 23),
    ENGINEERING_EXPERIMENT("ENGINEERING_EXPERIMENT", "工程实验", 24),

    // 实践课程细分
    PRODUCTION_PRACTICE("PRODUCTION_PRACTICE", "生产实习", 30),
    SOCIAL_PRACTICE("SOCIAL_PRACTICE", "社会实践", 31),
    TEACHING_PRACTICE("TEACHING_PRACTICE", "教学实习", 32),
    RESEARCH_PRACTICE("RESEARCH_PRACTICE", "科研实践", 33),
    GRADUATION_PROJECT("GRADUATION_PROJECT", "毕业设计", 34),

    // 混合课程细分
    LECTURE_PLUS_LAB("LECTURE_PLUS_LAB", "讲授+实验", 40),
    THEORY_PLUS_PRACTICE("THEORY_PLUS_PRACTICE", "理论+实践", 41),
    ONLINE_PLUS_OFFLINE("ONLINE_PLUS_OFFLINE", "线上+线下", 42),

    // 特殊教学形式
    FIELD_TRIP("FIELD_TRIP", "实地考察", 50),
    SEMINAR("SEMINAR", "研讨会", 51),
    WORKSHOP("WORKSHOP", "工作坊", 52),
    PROJECT_BASED("PROJECT_BASED", "项目制", 53),
    COMPETITION("COMPETITION", "竞赛类", 54);

    private final String code;
    private final String description;
    private final int order;

    TeachingClassType(String code, String description, int order) {
        this.code = code;
        this.description = description;
        this.order = order;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public int getOrder() {
        return order;
    }

    public static TeachingClassType fromCode(String code) {
        if (code == null || code.trim().isEmpty()) {
            return null;
        }

        for (TeachingClassType value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}